<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta th:replace="frontend/fragment/style"/>
    <title th:text="${indexVo.settings.website_title}"></title>
</head>
<body class="animated fadeIn">
<div id="index-app">
    <bmy-header :params="params" :home="current"></bmy-header>
    <hr class="header-hr">
    <bmy-block :quote="quote"></bmy-block>
    <bmy-articles>
        <bmy-list slot="list"></bmy-list>
        <bmy-info :utext="params.info_label" :qq="params.qq_login" slot="infoLabel" :su="su"
                  :order="params.info_panel_order"></bmy-info>
        <bmy-search :sw="sw" slot="search"></bmy-search>
        <bmy-cate :cates="cates" slot="cate"></bmy-cate>
        <bmy-random :articles="articles" slot="random"></bmy-random>
        <bmy-tab :tabs="tabs" slot="tab"></bmy-tab>
    </bmy-articles>
    <bmy-footer :words="params.footer_words"></bmy-footer>
</div>
<div th:replace="frontend/fragment/script"></div>
<script th:inline="javascript">
    BMY.indexVM = new Vue({
        el: "#index-app",
        data: {
            params: [[${indexVo.settings}]]
            , cates: [[${indexVo.cateList}]]
            , articles: [[${indexVo.randomArticles}]]
            , tabs: [[${indexVo.tagList}]]
            , current: true
            , su: [[${su}]]
            , quote: {
                showBlog: true
                , showSearch: false
                , showText: true
                , blogCount: [[${indexVo.blogCount}]]
                , searchCount: 0
                , showClock: true
                , text: [[${indexVo.settings.index_top_words}]]
            }
            , sw: BMY.getParam("s") !== undefined ? decodeURIComponent(BMY.getParam("s")) : BMY.getParam("s")
        },
        mounted: function () {
            BMY.stickyIt()
            BMY.affix = new hcSticky("#affix-side", {
                stickTo: '#main-body'
                , innerSticker: '#search-panel'
                , queries: {980: {disable: true}}
                , top: 75
                , onStart: function () {
                    if (!BMY.sticky()) {
                        BMY.affix.destroy();
                    }
                }
            })
        }
    })

</script>
<script>
    layui.config({base: '/static/assets/js/frontend/'}).extend({
        article: 'article'
    });
    layui.use(['laytpl', 'element', 'flow', 'article'], function () {
        var flow = layui.flow;
        var element = layui.element;
        var laytpl = layui.laytpl;
        var article = layui.article;

        flow.load({
            elem: '#article-list' //流加载容器
            , done: function (page, next) { //执行下一页的回调
                return article(page, next, laytpl);
            }
        });
    });


</script>
</body>
</html>